
        <HTML>
		<HEAD>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<meta name="description" content="Flash MX 2004 ActionScript2.0 Library: Factor - Wright Internet Solutions">
		<meta name="keywords" content="Factor,Flash,MX,2004,ActionScript,ActionScript2.0,AS2.0 Library,AS2,AS2 Library,Wright Internet Solutions,Wright,class,documentation,methods,functions,interfaces,JavaScript,Java">
		<TITLE>WIS AS2 Library : com.wis.math.num.Factor Documentation</TITLE>

		<STYLE><!--
		HR.small{height:1px; width:100%; background:#E7BFA3; border: 0px;}
		HR.big{height:4px; width:100%; background:#E7BFA3; border: 0px;}
		A:hover{text-decoration: underline}
		A{text-decoration: none; color: #993333}
		code{font-family: monospace; font-size: 12px; color: #666666;}
		.methodAttributesTitle{font-size: 12px; font-weight: bold; color: #7B779C}
		.ToC{font-size: 12px; font-weight: bold; color: #993333}
		.methodTitle{font-size: 14px; font-weight: bold; color: #993333}
		.groupTitle{font-size: 18px; font-weight: bold; color: #993333}
		.sectionTitle{font-size: 22px; font-weight: bold; color: #993333}
		.majorTitle{font-size: 32px; font-weight: bold; color: #993333; padding-bottom:100px;}
		.methodsDiv{margin-left:40px;}
		.footer{font-size: 11px; color: #666666;}
		body{font-family: arial,sans-serif; font-size: 12px;}
		//--></STYLE>

		</HEAD>
		<BODY bgColor='#ffffcc'>
		<P class='majorTitle'>com.wis.math.num.Factor Documentation</P>


		<P><B>Author:</B> <a href='mailto:wisolutions2002@shaw.ca?subject=wisASLibrary Factor Class'>Richard Wright</a><BR>
		<B>Last Modified:</B> 07/17/04 18:25:34<HR class='big'>

		<P class='sectionTitle'>Summary</P>
		<P class='ToC'>com.wis.math.num.Factor class:</P>
		<div class='methodsDiv'><a href='#classinfo'>- description</a></div>
<P class='ToC'>com.wis.math.num.Factor Properties:</P><div class='methodsDiv'>
<a href='#none'>- none</a><br>
</div><br>
<P class='ToC'>com.wis.math.num.Factor Methods:</P><div class='methodsDiv'>
<a href='# ln'>-  ln</a><br>
<a href='# logA'>-  logA</a><br>
<a href='# summation'>-  summation</a><br>
<a href='# square'>-  square</a><br>
<a href='# inverse'>-  inverse</a><br>
<a href='# pow2'>-  pow2</a><br>
<a href='# nRoot'>-  nRoot</a><br>
<a href='# factorial'>-  factorial</a><br>
<a href='# gammaApprox'>-  gammaApprox</a><br>
<a href='# factorialApprox'>-  factorialApprox</a><br>
<a href='# productFactors'>-  productFactors</a><br>
<a href='# fibonacci'>-  fibonacci</a><br>
<a href='# isPrime'>-  isPrime</a><br>
<a href='# isPrime2'>-  isPrime2</a><br>
<a href='# findPrimeFrom'>-  findPrimeFrom</a><br>
<a href='# primeFactor'>-  primeFactor</a><br>
<a href='# totient'>-  totient</a><br>
</div><br>

		<HR class='big'>
		<P class='sectionTitle'><A name='classinfo'></A>com.wis.math.num.Factor <I>class</I></P>
		<P> <span class='methodTitle'>version:</span> 1.6</P>
		<P class="methodTitle">description:</P>
		<P>Implements the static behaviours of the Factor Class.
 </P>
		<P class="methodTitle">usage:</P> <pre>Factor.classMethod(classProp);</pre>

<P> <span class='methodTitle'>parameters:</span>
				<ul>
<li>      none  -- no class input parameters.</li>
</ul>

			<HR class='small'>
			<P class='groupTitle'><A name='properties'></A>com.wis.math.num.Factor Properties:</P>
			<div class='methodsDiv' >


				<P class='methodTitle'><A name='none'></A><u> none</u></P>
				<P> -- no class properties.</P>
</div>

			<HR class='small'>
			<P class='groupTitle'><A name='methods'></A>com.wis.math.num.Factor Methods:</P>
			<div class='methodsDiv' >


				<P class='methodTitle'><A name=' ln'></A><u>  ln</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Defines the natural logarithm of 'n'.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Factor.ln(n);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  n   (Number)  -- a real number.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Number)  -- returns the natural logarithm of 'n'.
    </P>

				<P class='methodTitle'><A name=' logA'></A><u>  logA</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Defines the logarithm with base 'a' of 'n'.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Factor.logA(a,n);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  a   (Number)  -- a real number for 'log base'.</li>
<li>  n   (Number)  -- a real number.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Number)  -- returns the logarithm with base 'a' of 'n'.
    </P>

				<P class='methodTitle'><A name=' summation'></A><u>  summation</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Defines the sum of all the numbers between
     1 and 'n' raised to the 'x' power.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Factor.summation(n,x);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  n   (Number)  -- a real number.</li>
<li>  x   (Number)  -- a real number.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Number)  -- returns the sum of all the numbers between 1 and 'n' raised to the 'x' power.
    </P>

				<P class='methodTitle'><A name=' square'></A><u>  square</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Defines the square of a number.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Factor.square(n);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  n   (Number)  -- a real number.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Number)  -- returns the square of a number.
    </P>

				<P class='methodTitle'><A name=' inverse'></A><u>  inverse</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Defines the inverse of a number.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Factor.inverse(n);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  n   (Number)  -- a real number.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Number)  -- returns the inverse of a number.
    </P>

				<P class='methodTitle'><A name=' pow2'></A><u>  pow2</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Solves the negative value input bug.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Factor.pow2(a,n);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  a   (Number)  -- a real number, allowing negative input.</li>
<li>  n   (Number)  -- a real number.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Number)  -- returns a positive square from negative input.
    </P>

				<P class='methodTitle'><A name=' nRoot'></A><u>  nRoot</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Defines the nth root of a number.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Factor.nRoot(a,n);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  a   (Number)  -- a real number.</li>
<li>  n   (Number)  -- a real number.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Number)  -- returns the nth root of a number.
    </P>

				<P class='methodTitle'><A name=' factorial'></A><u>  factorial</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Recursive method that defines the factorial of a positive integer.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Factor.factorial(n);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  n   (Number)  -- a real integer.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Number)  -- returns the factorial of a positive integer.
    </P>

				<P class='methodTitle'><A name=' gammaApprox'></A><u>  gammaApprox</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Extends the domain of the factorial function by
     calculating the factorial of decimal numbers.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Factor.gammaApprox(n);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  n   (Number)  -- a real number.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Number)  -- returns the factorial of a positive floating point number.
    </P>

				<P class='methodTitle'><A name=' factorialApprox'></A><u>  factorialApprox</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Uses the Gamma function to approximate factorial - very fast.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Factor.factorialApprox(n);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  n   (Number)  -- a real number.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Number)  -- returns an integer approximation of the floating point input's factorial.
    </P>

				<P class='methodTitle'><A name=' productFactors'></A><u>  productFactors</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Calculates the product of factors of 'n'.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Factor.productFactors(n);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  n   (Number)  -- a real number.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Number)  -- returns the product of factors of 'n'.
    </P>

				<P class='methodTitle'><A name=' fibonacci'></A><u>  fibonacci</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Calculates total fibonacci levels in 'n'.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Factor.fibonacci(n);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  n   (Number)  -- a real number.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Number)  -- returns total fibonacci levels in 'n'.
    </P>

				<P class='methodTitle'><A name=' isPrime'></A><u>  isPrime</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Boolean for 'isPrime' integer condition, ignores decimals.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Factor.isPrime(n);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  n   (Number)  -- a real number.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Boolean)
    </P>

				<P class='methodTitle'><A name=' isPrime2'></A><u>  isPrime2</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Boolean for 'isPrime' integer condition, ignores decimals.
     I can't get this to work with the dependent prime functions,
     so I'm using the slower version above for now ... it works
     on it's own, however!!
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Factor.isPrime2(n);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  n   (Number)  -- a real number.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Boolean)
    </P>

				<P class='methodTitle'><A name=' findPrimeFrom'></A><u>  findPrimeFrom</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Defines an array of all primes between 'from' and 'n'
     inclusive, positive but restricted integer value,
     ignores decimals
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Factor.findPrimeFrom(n,from);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  n   (Number)  -- a real number.</li>
<li>  from   (Number)  -- a real number.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Array)  -- returns an array of all primes between 'from' and 'n' inclusive.
    </P>

				<P class='methodTitle'><A name=' primeFactor'></A><u>  primeFactor</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Defines prime factors of 'n', positive but
     restricted integer value, ignores decimals.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Factor.primeFactor(n);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  n   (Number)  -- a real number.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (String)  -- returns a string representation of the multiplication of primes of 'n'.
    </P>

				<P class='methodTitle'><A name=' totient'></A><u>  totient</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Defines total of relative primes of 'n'.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Factor.totient(n);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  n   (Number)  -- a positive integer.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Number)  -- returns total of relative primes of 'n'.
    </P>
</div>

			<BR>
			<BR>
			<HR class='big'>
			<span class="footer">generated with <A href='http://blog.klaustrofobik.org/' target='_blank'>AS2docGenerator beta 0.5.3</A></span>
			</BODY>
			</HTML>

